<template>
  <div>
    {{name}}
    <el-button type="primary">Primary</el-button>
  </div>
</template>

<script>
import { reactive, ref, toRefs } from "vue";
export default {
  name: "测试",
  // 定义模板
  components: {},
  //实例创建完成后被立即调用  同beforeCreate和created
  setup(props, context) {
    const state = reactive({
      name: "你好",
    });
    const num = ref(0);
    console.log(state.name, 11111);
    console.log(context, 11111);
    return {
      ...toRefs(state),
      num,
    };
  },
};
</script>
<style scoped lang ='less'>
</style>